package com.youmu.xxessj.ad

import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.youmu.xxessj.en.MyList
import com.youmu.xxessj.ut.Utils
import android.widget.Toast
import com.bumptech.glide.Glide
import com.youmu.xxessj.R
import com.youmu.xxessj.ut.HOME

class MyListad(data: List<MyList>): BaseQuickAdapter<MyList, BaseViewHolder>(R.layout.item_info,data), BaseQuickAdapter.OnItemClickListener  {
    override fun convert(helper: BaseViewHolder?, item: MyList?) {
        helper?.setText(R.id.bookname_it,item?.bookname)
        Glide.with(Utils.getContext()).load(HOME+item?.bookimg.toString()).into(helper?.getView(R.id.img)!!)
    }

    override fun onItemClick(adapter: BaseQuickAdapter<*, *>?, view: View?, position: Int) {
        Toast.makeText(Utils.getContext(), "嵌套RecycleView item 收到: 点击了第 $position 一次", Toast.LENGTH_SHORT).show()

    }
}